#!/usr/bin/env python3

import os
import flask

app = flask.Flask('')


@app.route('/do/<op>')
def route(op):
    os.system("""
    osascript -e 'tell application "Keyboard Maestro Engine" to do script "%s"'
    """ % op)
    return '<%s> success' % op


@app.route('/')
def index():
    return flask.send_file('index.html')


@app.route('/game')
def game():
    return flask.send_file('game.html')

app.run(debug=True, host='0.0.0.0', port=3000)
